package com.nantian.logic.controller.campusRelated;

import com.cuit.springboot.gdao.place.CityMapper;
import com.nantian.logic.utils.UniversalResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
@RestController
@RequestMapping(value = "/city")
public class CityController {
    @Autowired CityMapper cityMapper;
    @Autowired CityController cityController;

    @PostMapping(value = "/update")
    public UniversalResult update(@RequestBody Map map) {
//        activityRepository.update(activityEntity.getActId(),activityEntity.getActName());
//        activityMapper.updateConfirm(map);
        return new UniversalResult<>(UniversalResult.SUCCESS, "更新成功");
    }

    @PostMapping(value = "/selectById")
    public UniversalResult select(@RequestBody  Map map) {

        return new UniversalResult<>(UniversalResult.SUCCESS, "查询成功", cityMapper.selectByProid((Integer)map.get("proid")));
    }
}
